feat(stovepipe): Persist terminal build identity - #746
Draft
prathshenoy wants to merge 1 commit into
Draft
prathshenoy wants to merge 1 commit into
prathshenoy wants to merge 1 commit into
Conversation
prathshenoy
force-pushed
the
prath.shenoy/stovepipe-project-result-build
branch
3 times, most recently
from
September 25, 2026 03:19
208831a to
66cef3f
Compare
prathshenoy
force-pushed
the
prath.shenoy/stovepipe-project-result-build
branch
13 times, most recently
from
September 28, 2026 15:47
c354c8e to
9193d79
Compare
prathshenoy
marked this pull request as ready for review
September 28, 2026 15:47
prathshenoy
requested review from
a team,
behinddwalls and
sbalabanov
as code owners
September 28, 2026 15:47
prathshenoy
force-pushed
the
prath.shenoy/stovepipe-project-result-build
branch
from
September 28, 2026 16:24
9193d79 to
c354c8e
Compare
mnoah1
requested changes
Sep 28, 2026
| } | ||
|
|
||
| if err := c.markOutcome(ctx, store, request, outcomeState(status)); err != nil { | ||
| log, err := c.markOutcome(ctx, store, request, outcomeState(status), buildID) |
Contributor
There was a problem hiding this comment.
We should persist the build info on either request (as a terminal build field) or on the build itself (as a boolean indicating which one is considered the terminal build) since either of those tables are for use as operational state.
Then, as part of persistOutcomeLog, you could still update the TerminalBuild field there as well (so it's available via API) and create a history event for it. However, these are projections for the view, and exist separately from the core operational flows.
| // FinalizeOutcome atomically advances a Request to its terminal state and retains | ||
| // the matching state entry. Keeping the winning build id in that immutable entry | ||
| // means a crash cannot leave a terminal request without its selected build. | ||
| func (r *requestStore) FinalizeOutcome(ctx context.Context, request entity.Request, oldVersion, newVersion int32, log entity.RequestLog) (retErr error) { |
Contributor
There was a problem hiding this comment.
After change above, can update the state of the the build, and then update the summary/logs as two steps which no longer need to be atomic.
prathshenoy
force-pushed
the
prath.shenoy/stovepipe-project-result-build
branch
from
September 28, 2026 22:23
c354c8e to
b783b8f
Compare
prathshenoy
force-pushed
the
prath.shenoy/stovepipe-project-result-build
branch
2 times, most recently
from
September 28, 2026 22:24
17b670d to
75e62c0
Compare
prathshenoy
marked this pull request as draft
September 28, 2026 22:25
prathshenoy
force-pushed
the
prath.shenoy/stovepipe-project-result-build
branch
8 times, most recently
from
September 28, 2026 22:43
4748df4 to
039cf79
Compare
Summary: **What**: - Persist the winning terminal build ID on Request when a build reaches a terminal state. **Why**: - Make the selected build direct operational state for downstream artifact resolution. - Preserve first-writer-wins semantics when concurrent builds complete. Test Plan: - [x] `go test ./stovepipe/controller/buildsignal ./stovepipe/extension/storage/mysql` Revert Plan: - Revert this PR to remove the new Request field and restore the prior terminal-transition path. This is appropriate if no downstream consumer relies on the persisted build ID. Jira Issues: None
prathshenoy
force-pushed
the
prath.shenoy/stovepipe-project-result-build
branch
from
September 29, 2026 00:58
039cf79 to
55cc960
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What:
Why:
Test Plan
Revert Plan
Issues
CODEM-514